package com.lixixi.tingshu.user.api;

import com.lixixi.tingshu.common.result.Result;
import com.lixixi.tingshu.model.user.VipServiceConfig;
import com.lixixi.tingshu.user.service.VipServiceConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/user/vipServiceConfig")
public class UserVipApiController {

	@Autowired
	VipServiceConfigService vipServiceConfigService;

	@GetMapping("/findAll")
	Result<List<VipServiceConfig>> findAll(){
		List<VipServiceConfig> configs = vipServiceConfigService.list();
		return Result.ok(configs);
	}


	@GetMapping("/findById/{itemId}")
	Result<VipServiceConfig> findVipServiceById(@PathVariable("itemId") Long itemId){
		return Result.ok(vipServiceConfigService.getById(itemId));
	}
}
